<?php

namespace common\validate;

class EventLog extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    // SaveLogServerSetting 验证场景定义
    public function sceneSaveLogServerSetting()
    {
        return $this->append('data.request_url', 'require|max:128')
            ->append('data.websocket_url', 'require|max:128')
            ->append('data.access_key', 'require|max:255')
            ->append('data.secret_key', 'require|max:255');
    }

    // Select 验证场景定义
    public function sceneSelect()
    {
        return $this->append("param", 'require')
            ->append("param.filter", 'array')
            ->append("param.fields", 'require');
    }

    // GetFormattedEventLog 验证场景定义
    public function sceneGetFormattedEventLog()
    {
        return $this->append("param.filter.link_id", "require|integer")
            ->append("param.filter.module_code", "require")
            ->append("param.page", "array")
            ->append("param.order", "array");
    }
}
